workspace(name = "com_google_javascript_jscomp")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# From https://github.com/bazelbuild/rules_java/releases/
http_archive(
    name = "rules_java",
    url = "https://github.com/bazelbuild/rules_java/releases/download/5.4.1/rules_java-5.4.1.tar.gz",
    sha256 = "a1f82b730b9c6395d3653032bd7e3a660f9d5ddb1099f427c1e1fe768f92e395",
)
load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
rules_java_dependencies()
rules_java_toolchains()

http_archive(
    name = "rules_jvm_external",
    strip_prefix = "rules_jvm_external-77c3538b33cf195879b337fd48c480b77815b9a0",
    url = "https://github.com/bazelbuild/rules_jvm_external/archive/77c3538b33cf195879b337fd48c480b77815b9a0.zip",
    sha256 = "12695154251711a275f0e637731d87dcaf8d9c5a6bb200735325ebebc2feba02",
)

load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
rules_jvm_external_deps()

load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")
rules_jvm_external_setup()


http_archive(
    name = "protobuf_proto_rules",
    # output from `sha256sum` on the downloaded tar.gz file
    sha256 = "66bfdf8782796239d3875d37e7de19b1d94301e8972b3cbd2446b332429b4df1",
    strip_prefix = "rules_proto-4.0.0",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.tar.gz",
        "https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.tar.gz",
    ],
)

load("@protobuf_proto_rules//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
rules_proto_toolchains()

#
# To update google_bazel_common, locate the git commit to depend on and
# use something like the following to determine the sha256
#  curl -L https://github.com/google/bazel-common/archive/<git-commit-id>.zip |
#  sha256
#
#
http_archive(
    name = "google_bazel_common",
    # output from `sha256sum` on the downloaded zip file
    sha256 = "9e966f57182e76ba2f5a692ec410e32e5c77808220fd94f99071caac5310a019",
    strip_prefix = "bazel-common-65f295afec03cce3807df5b06ef42bf8e46df4e4",
    urls = [
      "https://github.com/google/bazel-common/archive/65f295afec03cce3807df5b06ef42bf8e46df4e4.zip",
    ],
)

load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules")

google_common_workspace_rules()

# Jarjar is a Google tool (https://github.com/google/jarjar) for generating
# shaded JARs (https://stackoverflow.com/questions/49810578). This repo contains
# Bazel bindings for Jarjar, under the Apache license.
http_archive(
    name = "com_github_johnynek_bazel_jar_jar",
    # output from `sha256sum` on the downloaded zip file
    sha256 = "fdf2c5276e5c6f27efa1e0b64a301f5a122d84a4c1c0dd80006dbbc530a16773",
    strip_prefix = "bazel_jar_jar-171f268569384c57c19474b04aebe574d85fde0d",
    urls = [
      "https://github.com/johnynek/bazel_jar_jar/archive/171f268569384c57c19474b04aebe574d85fde0d.zip",
    ],
)

load("@com_github_johnynek_bazel_jar_jar//:jar_jar.bzl", "jar_jar_repositories")

jar_jar_repositories()

load("@rules_jvm_external//:defs.bzl", "maven_install")
load("//license_check:maven_artifacts.bzl", "MAVEN_ARTIFACTS")

maven_install(
    artifacts = MAVEN_ARTIFACTS,
    repositories = [
        "https://maven.google.com",
        "https://repo1.maven.org/maven2",
    ],
)
